﻿using KingerRobot.PCRBW.SpiService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace KingerRobot.PCRBW.Spi;

public interface ITaskService
{
    /// <summary>
    /// 根据taskNo查询实体
    /// </summary>
    /// <param name="taskNo"></param>
    /// <returns></returns>
    TaskAndCmdBean QueryByTaskNo(int taskNo);
    /// <summary>
    /// 更新任务和指令状态
    /// </summary>
    /// <returns></returns>
    int UpdateTaskAndCmdStatus(long locId,int taskId, int Status);
    /// <summary>
    /// 创建入库滑台任务
    /// </summary>
    /// <param name="equip_name"></param>
    /// <returns></returns>
    MesProductTask CreateSlibeTableTask(string equip_name, int source_type);
    /// <summary>
    /// 创建入库
    /// </summary>
    /// <param name="equip_code">龙门</param>
    /// <param name="status"></param>
    /// <returns></returns>
    int CreateWarehouseing(long equip_id, int status,string slidtable);
    /// <summary>
    /// 创建桁架任务
    /// </summary>
    /// <param name="equip_id"></param>
    /// <param name="targetName"></param>
    /// <param name="status"></param>
    /// <returns></returns>
    int CreateTruss(long equip_id, string targetName, int status);
    /// <summary>
    /// 查询第一条数据
    /// </summary>
    /// <param name="whereExpression"></param>
    /// <returns>TaskAndCmdBean</returns>
    TaskAndCmdBean QueryFrist(Expression<Func<POWcsTask, bool>> whereExpression);
    /// <summary>
    /// 执行出库任务创建
    /// </summary>
    /// <param name="equip_id"></param>
    /// <param name="status"></param>
    /// <returns></returns>

    int CreateExWarehouse(long equip_id, int status);
    /// <summary>
    /// 获取所有任务
    /// </summary>
    /// <param name="equipId"></param>
    /// <returns></returns>
    List<TaskCmdAndLocDto> GetTaskAndCmdBeanByCmdEquipId(long equipId);
    /// <summary>
    /// 桁架任务
    /// </summary>
    /// <param name="equipId"></param>
    /// <returns></returns>
    List<TaskCmdAndLocDto> GetTrussTaskAndCmdBeanByCmdEquipId(long equipId);

    /// <summary>
    /// 清理删除、已完成任务
    /// </summary>
    int ClearManualCleanTask();
    /// <summary>
    /// 备份数据
    /// </summary>
    void BakTaskAndOrder();
}
